package chapter02

import java.io.IOException

object ExceptionTest extends App {
    
  try{
    val k=1/0
  val line   =  scala.io.Source.fromFile("d:/scala.txt").mkString
  }catch{
    case _:NullPointerException=>{
      println("NullPointerException")
    }
    case _:IOException=>{
         println("IOException")
    }
    case ex:Exception=>{
      println(ex.printStackTrace())
    }
  }
  
}